<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>
            <h2>用户列表</h2>
            <h3>                
            <a href="<?php echo U('Admin/User/index');?>">退出</a>
            <a href="<?php echo U('Admin/User/add');?>">添加</a>
            </h3>
            <table>
                <tr>
                    <th>用户名</th>
                    <th>权限</th>
                    <th>操作</th>
                </tr>
                <?php foreach($data as $key=>$value){?>
                <tr>
                    <td><?php echo $value['name'];?></td>
                    <td><?php  if($value['role']==1){
                        echo "超级管理员";}else{
                        echo "编辑人员";}
                        ;?>
                    </td>
                    <td>
                        <a href="<?php echo U('Admin/User/update?id='.$value['id']);?>">更新</a>
                        <a href="<?php echo U('User/delete?id='.$value['id']);?>">删除</a>
                    </td>
                </tr>
                <?php }?>
            </table>
        </div>
    </body>
</html>
